package com.eriloan.easyPage.service;

import java.util.LinkedList;
import java.util.Map;

import com.eriloan.easyPage.beans.ListenerBean;
import com.eriloan.easyPage.beans.RouteInfo;
import com.eriloan.easyPage.exception.ControllerException;
import com.eriloan.easyPage.exception.ConversionTypeException;
import com.eriloan.easyPage.exception.ListenerException;
import com.eriloan.easyPage.exception.OperateSpringBeanException;
import com.eriloan.easyPage.exception.UnknownException;

/**
 * 
 * <p>Copyright: All Rights Reserved</p>
 * <p>Company: 北京荣之联科技股份有限公司 http://www.ronglian.com</p>
 * <p>Description: 框架核心处理 Service 接口</p>
 * <p>Author:Eric Shi/史丙利</p>
 */
public interface IEasyPageService{

	/**
	 * 
	 * <br/>Description:获取路由信息集合
	 * <p>Author:Eric Shi/史丙利</p>
	 * 
	 * @param packageDir
	 * @param filters
	 * @return
	 */
	public LinkedList<RouteInfo> getRouteInfos(String packageDir,String filters);

	/**
	 * 
	 * <br/>Description:返回所有的监听实现类
	 * <p>Author:Eric Shi/史丙利</p>
	 * 
	 * @param packageDir
	 * @return
	 */
	public LinkedList<ListenerBean> getlistenerBeans(String packageDir);

	/**
	 * 
	 * <br/>Description:判断传入类是否实现的EasyPageListener接口
	 * <p>Author:Eric Shi/史丙利</p>
	 * 
	 * @param clazz
	 * @return
	 */
	public boolean isImplementsEasyPageListener(Class<?> clazz);

	/**
	 * 
	 * <br/>Description:判断请求地址是否包含在路由表内，有则返回对应的实体
	 * <p>Author:Eric Shi/史丙利</p>
	 * 
	 * @param routeInfos
	 * @param route
	 * @param methodType
	 * @return
	 */
	public Map<String,Object> isRouteInfos(LinkedList<RouteInfo> routeInfos,String route,String methodType);

	/**
	 * 
	 * <br/>Description:根据参数执行对应的方法
	 * <p>Author:Eric Shi/史丙利</p>
	 * 
	 * @param routeInfo
	 * @param listenerBeans
	 * @param isSupportSpring
	 * @return
	 * @throws ControllerException
	 * @throws OperateSpringBeanException
	 * @throws ListenerException
	 * @throws ConversionTypeException
	 * @throws UnknownException 
	 */
	public Object methodInvoke(RouteInfo routeInfo,LinkedList<ListenerBean> listenerBeans,boolean isSupportSpring) throws ConversionTypeException,ListenerException,OperateSpringBeanException,ControllerException, UnknownException;

}
